package top.scsoul.boot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.scsoul.boot.bean.XhrResponse;
import top.scsoul.boot.entity.BaseDict;
import top.scsoul.boot.service.BaseDictService;

import java.util.List;

@RestController
public class BaseDictController {
    @Autowired
    BaseDictService baseDictService;

    @RequestMapping("api/dic/{type}")
    public XhrResponse listA(@PathVariable String type) {
        List<BaseDict> baseDicts = baseDictService.queryByTypeCode(type);
        return XhrResponse.success(baseDicts);
    }
}
